Xbasic

CHR Function

Syntax

Single_Character as C = CHR(N ascii_value)

Arguments

ascii_value

A number from -255 through 255, inclusive. Numeric

Description

Converts a numeric expression to a character expression.

Discussion

CHR() returns the Single_Character corresponding to the integer ASCII_Value. Note : The ASCII_Value used in the ALT-value sequence for typing a non-standard character is not always the same value that CHR() requires. For example ALT 241 produces " ", but CHR(-79) produces " ". To determine the value required by the CHR() function, use the ASC() function first, as in ASC(" ").

Example

chr(68) -> "D"
chr( asc(CITY) ) -> "M", if CITY contains "Montreal"

See Also